#pragma once

#include <iostream>
#include <cstring>
#include <cerrno>
#include <unistd.h>
#include <fcntl.h>

void setNonBlock(int fd)
{
    int fl = fcntl(fd, F_GETFL);
    if(fl < 0)
    {
        std::cerr << "errno: " << errno << " err_msg: " << strerror(errno) << std::endl;
        exit(1); 
    }
    fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}

void printLog()
{
    std::cout << "this is a log!" << std::endl;
}

void downLoad()
{
    std::cout << "this is a download!" << std::endl;
}

void execSql()
{
    std::cout << "this is a sql!" << std::endl;
}